package com.ikas.ai.server.module.alarm.model.dto;

import com.ikas.ai.server.module.alarm.model.enums.AlarmType;
import lombok.Data;

import java.io.Serializable;

@Data
public class AlarmMachineStateDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 是否存在跳机报警
     */
    Integer tripAlarmCount = 0;
    /**
     * 是否存在劣化消缺报警
     */
    Integer unitDeteriorationAlarmCount = 0;

    Integer steadyAlarmCount = 0;

    public void setAlarm(AlarmType type,Integer num) {
        switch (type){
            case TRIP:
                this.tripAlarmCount = num;
                break;
            case UNIT_DETERIORATION:
                this.unitDeteriorationAlarmCount = num;
                break;
            case STEADY_ALARM:
                this.steadyAlarmCount = num;
                break;
        }
    }
    public void clearAlarm(AlarmType type) {
        switch (type){
            case TRIP:
                this.tripAlarmCount = 0;
                break;
            case UNIT_DETERIORATION:
                this.unitDeteriorationAlarmCount = 0;
                break;
            case STEADY_ALARM:
                this.steadyAlarmCount = 0;
                break;
        }
    }
}
